package com.seelyn.ddvideo.spider;

import com.seelyn.ddvideo.service.SpiderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author slacrey
 * @since 2017/6/11
 */
@Component
public class VideoTimer {

    @Autowired
    private SpiderService spiderService;

    //每3秒执行一次
    @Scheduled(cron = "10 50 1 * * ?")
    public void timerRate() {

        spiderService.startYouKuSpider(0);
        spiderService.startQQSpider(0);
    }

    //每天1点10分10秒时执行
    @Scheduled(cron = "10 10 1 * * ?")
    public void qqTimerCron() {

        spiderService.startKuyunSpider(0);

    }

    //每天1点10分10秒时执行
    @Scheduled(cron = "10 30 1 * * ?")
    public void kuyunTimerCron() {

        spiderService.startKuyunSpider(0);

    }

    //每天1点10分10秒时执行
    @Scheduled(cron = "10 40 1 * * ?")
    public void m3u8TimerCron() {

        spiderService.startM3u8Spider(0);

    }

}
